-
Notifications
You must be signed in to change notification settings - Fork 88
feat(cloudflare): add custom domain support for R2 buckets #1147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add comprehensive custom domain configuration for R2 buckets with automatic DNS management: - Add `customDomain` property to `BucketProps` with domain, zoneId, enabled, minTLS, and ciphers configuration - Automatically create and manage proxied CNAME DNS records pointing to public.r2.dev - Handle DNS record lifecycle (create, update, delete) alongside custom domain operations - Detect and preserve read-only DNS records created by Cloudflare dashboard - Support TLS version and cipher suite customization - Handle domain name changes by cleaning up old records and creating new ones - Add comprehensive test coverage for custom domain CRUD operations - Add documentation with examples for using custom domains 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
… domains When changing the custom domain for an R2 bucket (e.g., from test.domain.com to test2.domain.com), Cloudflare sometimes creates read-only DNS records that are managed automatically by the R2 service. Attempting to delete these read-only records would fail with a "Bad Request" error. This change improves the `deleteR2CustomDomainDnsRecord` function to: - Check if the DNS record exists and whether it's read-only before deletion - Silently skip deletion if the record is read-only (managed by Cloudflare) - Only attempt deletion for records that are not read-only This eliminates the warning message when changing custom domains and ensures smooth transitions between different domain configurations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
Closing in favor of #1181 |
Adds comprehensive custom domain configuration for Cloudflare R2 buckets with automatic DNS management, enabling production-ready content
delivery through custom domains.
Features
Custom Domain Configuration: New
customDomainproperty onR2Bucketsupporting:Automatic DNS Management:
public.r2.devFull CRUD Support:
Example Usage